import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms/src/forms";

import { HomePage } from '../pages/home/home';
import { DiscoveryPage } from '../pages/discovery/discovery';
import { ChatPage } from '../pages/chat/chat';
import { NotificationPage } from '../pages/notification/notification';
import { MorePage } from '../pages/more/more';
import { RegisterPage } from '../pages/register/register';
import { UserPage } from '../pages/user/user';

import { TabsPage } from '../pages/tabs/tabs';

import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { RestProvider } from '../providers/rest/rest';
import { HttpModule } from '@angular/http';
import { LoginPage } from '../pages/login/login';
import { IonicStorageModule } from '@ionic/storage';
import { HeadfacePage } from '../pages/headface/headface';
import { QuestionPage } from '../pages/question/question';
import { DetailsPage } from '../pages/details/details';
import { AnswerPage } from '../pages/answer/answer';
import { UserdatalistPage } from '../pages/userdatalist/userdatalist';
import { ScanPage } from '../pages/scan/scan';



import { File } from '@ionic-native/file';
import { FileTransfer, FileTransferObject } from '@ionic-native/file-transfer';
import { FilePath } from '@ionic-native/file-path';
import { Camera } from '@ionic-native/camera';
import { ChartdetailsPage } from '../pages/chartdetails/chartdetails';
import { EmojiProvider } from '../providers/emoji/emoji';
import { ComponentsModule } from '../components/components.module';
import { ChatserviceProvider } from '../providers/chatservice/chatservice';
import { SettingProvider } from '../providers/setting/setting';
import { QRScanner } from '@ionic-native/qr-scanner';
import { PipesModule } from '../pipes/pipes.module';



@NgModule({
  declarations: [
    MyApp,
    HomePage,
    DiscoveryPage,
    ChatPage,
    NotificationPage,
    MorePage,
    TabsPage,
    LoginPage,
    RegisterPage,
    UserPage,
    HeadfacePage,
    QuestionPage,
    DetailsPage,
    AnswerPage,
    ChartdetailsPage,
    UserdatalistPage,
    ScanPage
  ],
  imports: [
    BrowserModule,
    HttpModule,
    ComponentsModule,
    PipesModule,
    IonicModule.forRoot(MyApp, {
      mode: "ios",
      backButtonText: '返回',
      backButtonTextColor:'#000',
      tabsHideOnSubPages: true
    }),
    IonicStorageModule.forRoot() //全局的存储
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage,
    DiscoveryPage,
    ChatPage,
    NotificationPage,
    MorePage,
    TabsPage,
    LoginPage,
    RegisterPage,
    UserPage,
    HeadfacePage,
    QuestionPage,
    DetailsPage,
    AnswerPage,
    ChartdetailsPage,
    UserdatalistPage,
    ScanPage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    RestProvider,
    File,
    FileTransfer,
    FileTransferObject,
    FilePath,
    Camera,
    { provide: ErrorHandler, useClass: IonicErrorHandler },
    RestProvider,
    EmojiProvider,
    ChatserviceProvider,
    SettingProvider,
    QRScanner
  ]
})
export class AppModule { }
